import network

ssid='s-night-y'
password='18084821996smy'

wlan = network.WLAN(network.STA_IF) # create station interface
wlan.active(True)       # activate the interface
print (wlan.scan())             # scan for access points
print (wlan.isconnected() )     # check if the station is connected to an AP
wlan.connect(ssid, password) # connect to an AP
wlan.config('mac')      # get the interface's MAC address
print (wlan.ifconfig())         # get the interface's IP/netmask/gw/DNS addresses
